package shuangzu.top.zzurla.utils;

import java.util.Calendar;

public class utils_date {
    public Calendar c;

    public String getnow_national()
    {
        c=Calendar.getInstance();
        String date="";
        date=get_week(c) + " " + get_month(c) + " " + (c.get(Calendar.DATE)-1) + " " + get_time(c) + " CST " + get_year(c);
        return date;
    }

    public String get_week(Calendar tempc)
    {
        String date="";
        switch (tempc.get(Calendar.DAY_OF_WEEK))
        {
            case Calendar.MONDAY:
                date="Mon";
                break;
            case Calendar.TUESDAY:
                date="Tue";
                break;
            case Calendar.THURSDAY:
                date="Thur";
                break;
            case Calendar.WEDNESDAY:
                date="Wed";
                break;
            case Calendar.FRIDAY:
                date="Fri";
                break;
            case Calendar.SATURDAY:
                date="Sat";
                break;
            case Calendar.SUNDAY:
                date="Sun";
                break;
        }
        return date;
    }
    public String get_month(Calendar tempc)
    {
        String date="";
        switch (tempc.get(Calendar.MONTH) + 1)
        {
            case 1:
                date="Jan";
                break;
            case 2:
                date="Feb";
                break;
            case 3:
                date="Mar";
                break;
            case 4:
                date="Apr";
                break;
            case 5:
                date="May";
                break;
            case 6:
                date="June";
                break;
            case 7:
                date="July";
                break;
            case 8:
                date="Aug";
                break;
            case 9:
                date="Sept";
                break;
            case 10:
                date="Oct";
                break;
            case 11:
                date="Nov";
                break;
            case 12:
                date="Dec";
                break;
        }
        return date;
    }

    String get_time(Calendar tempc)
    {
        String date=(tempc.get(Calendar.HOUR_OF_DAY)+10) + ":" + tempc.get(Calendar.MINUTE) + ":" + tempc.get(Calendar.SECOND);
        return date;
    }

    int get_year(Calendar tempc)
    {
        return tempc.get(Calendar.YEAR);
    }


}
